using System;
using System.Collections.Generic;
using System.Data;
using System.Text;


namespace Schemata.Core
{
    /// <summary>
    /// Represents a generic database column.
    /// </summary>
    public class ColumnSchema : GenericSchema
    {
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="table"></param>
        /// <param name="isPrimaryKeyMember"></param>
        /// <param name="dataType"></param>
        public ColumnSchema(string name, TableSchema table, bool isPrimaryKeyMember, DbType dataType)
        {
            this.Name = name;
            this.Table = table;
            this.IsPrimaryKeyMember = isPrimaryKeyMember;
            this.DataType = dataType;
        }

       
        /// <summary>
        /// Gets or sets the table to which this column belongs.
        /// </summary>
        public TableSchema Table
        {
            get { return _table; }
            set { _table = value; }
        }
        private TableSchema _table;

        
        /// <summary>
        /// Gets or sets a value indicating if this column is part of the 
        /// table's primary key.
        /// </summary>
        public bool IsPrimaryKeyMember
        {
            get { return _isPrimaryKeyMember; }
            set { _isPrimaryKeyMember = value; }
        }
        private bool _isPrimaryKeyMember;

        
        /// <summary>
        /// Gets or sets the System.Data.DbType of this column.
        /// </summary>
        public DbType DataType
        {
            get { return _dataType; }
            set { _dataType = value; }
        }
        private DbType _dataType;
    }
}
